import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

//圆角图片
class RoundImagePage extends StatelessWidget {
  final double width;
  final double height;
  final String url;
  final double radius;
  final String defaultAssetPath;

  RoundImagePage(
      {Key key,
      this.width = double.infinity,
      this.height,
      this.url,
      this.defaultAssetPath,
      this.radius})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      height: height,
      width: width,
      child: ClipRRect(
        borderRadius: BorderRadius.circular(radius),
        child: FadeInImage.assetNetwork(
          placeholder: defaultAssetPath,
          image: url,
          fit: BoxFit.cover,
        ),
      ),
    );
  }
}
